'Copyright ?1995-2007, Camstar Systems, Inc. All Rights Reserved.
'Camstar provides sample code as is without warranty of any kind, 
'either express or implied, including but not limited to the implied 
'warranties of merchantability and/or fitness for a particular purpose.

Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports Infragistics.WebUI.UltraWebGrid

Imports Camstar.WebClient.FormsBuilder.WebForm
Imports Camstar.WebClient.FrameworkManager
Imports Camstar.WebClient.WebServicesProxy.InSiteWebServices
Imports Camstar.WebClient.Core.WebUtil
Imports Camstar.Util
Imports Camstar.WebClient.WebConstants
Imports Camstar.WebClient.FormsBuilder.FormsBuilderCore
Imports Camstar.WebClient.FormsBuilder.WebControls

Namespace InSiteWebApplication

    Partial Class ModelingAuditTrailPopupForm
        Inherits PopupForm

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            MyBase.OnPageLoad(sender, e)

            If Not IsPostBack Then
                HandleGridClientInitialization()
            End If
        End Sub ' Page_Load

        Protected Overrides Sub LoadData()
            NamedMaint.LoadLabels()
        End Sub 'LoadData

        ' Creates DataSet structure and fills it with requested headers
        Private Function GetDataSource(ByVal headers() As AuditTrailHeader) As DataSet
            Dim dataSource As DataSet = Nothing
            If Not headers Is Nothing Then
                dataSource = New DataSet

                Dim tableParent As New DataTable
                tableParent.Columns.Add(mkIdColumn, GetType(Integer)).AutoIncrement = True
                tableParent.Columns.Add(mkHeaderIdColumn)
                tableParent.Columns.Add(mkObjectInstanceIdColumn)
                tableParent.Columns.Add(mkDateColumn, GetType(DateTime))
                tableParent.Columns.Add(mkUserColumn)
                tableParent.Columns.Add(mkExecuteActionColumn)
                tableParent.Columns.Add(mkCommentsColumn)
                tableParent.Columns.Add(mkExpandingColumn, GetType(Boolean))
                tableParent.PrimaryKey = New DataColumn() {tableParent.Columns(mkIdColumn)}
                dataSource.Tables.Add(tableParent)

                For Each header As ModelingAuditTrailHeader In headers
                    tableParent.Rows.Add(New Object() {Nothing, header.__Id, header.ObjectInstanceId, _
                        header.TxnDate, header.UserName, header.ExecuteAction, header.Comments, True})
                Next

                AddChildTable(tableParent)
            End If

            Return dataSource
        End Function ' GetDataSource

        Function AddChildTable(ByVal parentTable As DataTable) As DataTable
            Dim tableChild As New DataTable
            tableChild.Columns.Add(mkIdColumn, GetType(Integer)).AutoIncrement = True
            tableChild.Columns.Add(mkParentIdColumn, GetType(Integer))
            tableChild.Columns.Add(mkHeaderIdColumn)
            tableChild.Columns.Add(mkObjectInstanceIdColumn)
            tableChild.Columns.Add(mkItemColumn)
            tableChild.Columns.Add(mkItemNameColumn)
            tableChild.Columns.Add(mkBeforeColumn)
            tableChild.Columns.Add(mkAfterColumn)
            tableChild.Columns.Add(mkActionColumn)
            tableChild.Columns.Add(mkExpandingColumn, GetType(Boolean))
            tableChild.PrimaryKey = New DataColumn() {tableChild.Columns(mkIdColumn)}
            parentTable.DataSet.Tables.Add(tableChild)

            parentTable.DataSet.Relations.Add(parentTable.Columns(mkIdColumn), tableChild.Columns(mkParentIdColumn))
            Return tableChild
        End Function ' AddChildTable

        ' Parses popup data, loads audit trail headers and stores them in the session
        Private Sub PrepareHeaders()
            Me.PopupData = Session("PopupData")
            If Me.PopupData Is Nothing Then
                Exit Sub
            End If
            Dim ReceivedDataFromParent() As String = Me.PopupData
            If Not ReceivedDataFromParent Is Nothing Then
                If ReceivedDataFromParent.Length >= 10 Then
                    ' Parse popup data
                    Dim auditTrailType As String = ReceivedDataFromParent(0)
                    Dim instanceName As String = ReceivedDataFromParent(1)
                    Dim revision As String = ReceivedDataFromParent(2)
                    Dim objectTypeDisplayName As String = ReceivedDataFromParent(3)
                    Dim objectTypeName As String = ReceivedDataFromParent(4)
                    Dim parentName As String = ReceivedDataFromParent(5)
                    Dim parentTypeDisplayName As String = ReceivedDataFromParent(6)
                    Dim parentTypeName As String = ReceivedDataFromParent(7)
                    Dim parentRevision As String = ReceivedDataFromParent(8)
                    Dim subentityID As String = ReceivedDataFromParent(9)

                    ' Prepare NDO/RDO fields
                    If StringUtil.IsEmptyString(revision) Then 'NDO
                        NDOField.Text = objectTypeDisplayName
                        NDOField.TextEditControl.Text = instanceName
                        RDOField.Visible = False
                    Else 'RDO
                        RDOField.Text = objectTypeDisplayName
                        RDOField.TextEditControl.Text = instanceName
                        RDOField.RevisionControl.Text = revision
                        NDOField.Visible = False
                    End If

                    ' Request audit trail headers
                    Dim headerRecords() As AuditTrailHeader = GetModelingAuditTrailHeaders(instanceName, revision, objectTypeName, subentityID)

                    ' Fill DataSet instance with loaded headers
                    Dim dataSource As DataSet = GetDataSource(headerRecords)
                    If Not dataSource Is Nothing Then
                        ' Store requested headers in the session
                        Dim store As SessionStore = FrameworkManagerUtil.GetSessionStore(Page.Session)
                        If Not store Is Nothing Then
                            ' Add currently created data
                            store(PageInstanceId, SessionStoreId) = dataSource
                            store(PageInstanceId, "PopupData") = Me.PopupData
                        End If
                    End If
                End If

            End If
        End Sub ' PrepareHeaders

        ' Returns the stored data in DataSet structure
        Private Function LoadHeaderItems() As DataSet
            Dim dataSource As DataSet = Nothing

            Dim store As SessionStore = FrameworkManagerUtil.GetSessionStore(Page.Session)
            If Not store Is Nothing Then
                dataSource = store(PageInstanceId, SessionStoreId)
            End If

            Return dataSource
        End Function ' LoadHeaderItems

        ' Loads details for the current item
        Private Function LoadDetailItems() As DataSet
            Dim dataSource As DataSet = Nothing
            If mExpandingRowId <> -1 Then
                ' Get stored data
                Dim store As SessionStore = FrameworkManagerUtil.GetSessionStore(Page.Session)
                If Not store Is Nothing Then
                    dataSource = store(PageInstanceId, SessionStoreId)
                    If Not dataSource Is Nothing Then
                        ' Associate row clicked on the form with row on the stored table
                        Dim currentTable As DataTable = dataSource.Tables(mExpandingBandIndex)
                        Dim row As DataRow = currentTable.Rows.Find(mExpandingRowId)
                        Dim childTable As DataTable = currentTable.ChildRelations(0).ChildTable

                        ' Add new child band
                        If childTable.ChildRelations.Count = 0 Then
                            AddChildTable(childTable)
                        End If

                        If row.GetChildRows(currentTable.ChildRelations(0)).Length = 0 Then
                            ' If details for the current item was not requested earlier
                            Dim auditTrailDetail As AuditTrail = GetModelingAuditTrailDetails(row(mkHeaderIdColumn), row(mkObjectInstanceIdColumn))
                            Dim fields() As AuditTrailField = Nothing
                            Dim processFields As Boolean = False
                            If TypeOf auditTrailDetail Is ModelingAuditTrail Then
                                Dim modelingDetail As ModelingAuditTrail = CType(auditTrailDetail, ModelingAuditTrail)

                                If Not modelingDetail.Fields Is Nothing Then
                                    If modelingDetail.Fields.Length > 0 Then
                                        fields = modelingDetail.Fields
                                    End If
                                End If
                            End If

                            If Not fields Is Nothing Then
                                For Each modelingField As AuditTrailField In fields

                                    'Subentity Field
                                    If TypeOf modelingField Is AuditTrailSubentityField Then
                                        Dim fieldValues() As AuditTrailSubentityInfo = CType(modelingField, AuditTrailSubentityField).FieldValues
                                        For Each fieldValue As AuditTrailSubentityInfo In fieldValues
                                            childTable.Rows.Add(New Object() {Nothing, row(mkIdColumn), _
                                                    fieldValue.HeaderId, fieldValue.ObjectInstanceId, _
                                                    modelingField.DisplayLabel, fieldValue.ObjectDisplayName, Nothing, Nothing, fieldValue.Action, True})
                                        Next

                                        'Trivial Field
                                    ElseIf TypeOf modelingField Is AuditTrailTrivialField Then
                                        Dim fieldValues() As AuditTrailTrivialFieldValue = CType(modelingField, AuditTrailTrivialField).FieldValues
                                        Dim act As String
                                        For Each fieldValue As AuditTrailTrivialFieldValue In fieldValues
                                            If fieldValue.Action = Nothing Then
                                                act = modelingField.Action
                                            Else
                                                act = fieldValue.Action
                                            End If

                                            Dim oldValue As String = Server.HtmlEncode(fieldValue.OldValue)
                                            Dim newValue As String = Server.HtmlEncode(fieldValue.NewValue)

                                            If CType(modelingField, AuditTrailTrivialField).FieldSubType = mkDurationType Then
                                                oldValue = Duration.ConvertDataToDuration(fieldValue.OldValue)
                                                newValue = Duration.ConvertDataToDuration(fieldValue.NewValue)
                                            End If

                                            childTable.Rows.Add(New Object() {Nothing, row(mkIdColumn), Nothing, _
                                                    Nothing, modelingField.DisplayLabel, Nothing, IIf(modelingField.Action.ToLower() = "create", "", oldValue), _
                                                    newValue, act, False})
                                        Next
										If (Not fieldValues is Nothing) AndAlso (fieldValues.Length = 0) Then
											childTable.Rows.Add(New Object() {Nothing, row(mkIdColumn), Nothing, _
												Nothing, modelingField.DisplayLabel, Nothing, Nothing, Nothing, modelingField.Action, False})
										End If
                                    End If
                                Next
                            Else
                                ' TODO: should be checked when server-side core will 
                                ' be fixed concerning "Updated" subentities
                                childTable.Rows.Add(New Object() {Nothing, row(mkIdColumn), Nothing, _
                                    Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, False})
                            End If
                        End If
                    End If
                End If
            End If

            Return dataSource
        End Function ' LoadDetailItems

        ' Inintialize datasourse occures
        Protected Sub AuditTrailField_InitializeDataSource(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.UltraGridEventArgs) Handles AuditTrailField.InitializeDataSource
            Dim dataSource As DataSet = Nothing

            If Not AuditTrailField.IsXmlHttpRequest And Not IsPostBack Then
                ' Initial page loading
                PrepareHeaders()
                dataSource = LoadHeaderItems()
            ElseIf IsPageRequest Then
                ' Requesting new page
                dataSource = LoadHeaderItems()
            ElseIf AuditTrailField.IsXmlHttpRequest And IsPostBack Then
                ' Requesting of item details
                dataSource = LoadDetailItems()
            End If

            AuditTrailField.DataSource = dataSource
        End Sub ' AuditTrailField_InitializeDataSource

        ' Requests audit trail headers
        Private Function GetModelingAuditTrailHeaders(ByVal Name As String, ByVal Revision As String, ByVal ObjectTypeName As String, ByVal InstanceID As String) As AuditTrailHeader()
            Dim auditTrailInquiry As ModelingAuditTrailInquiry = New ModelingAuditTrailInquiry
            Dim responseData As ModelingAuditTrailInquiry = New ModelingAuditTrailInquiry
            Dim auditTrailHeaderInfo As ModelingAuditTrailInquiry_Info = New ModelingAuditTrailInquiry_Info

            Dim auditTrailHeaders() As AuditTrailHeader = Nothing

            Dim headers() As ModelingAuditTrailHeader = {New ModelingAuditTrailHeader}
            auditTrailInquiry.Headers = headers

            'If Not StringUtil.IsEmptyString(dcFromDate.SelectionData) And Not StringUtil.IsEmptyString(dcToDate.SelectionData) Then

            auditTrailInquiry.DateFromFilter = dcFromDate.SelectionData
            If (Not dcToDate.SelectionData Is Nothing) Then
                ' For the end date, we want the entire day that the user selected. So, bump the date filter up by one day.
                Dim dtAdjToDate As DateTime = DateTime.Parse(dcToDate.SelectionData).AddDays(1)
                Dim data As String = dtAdjToDate.ToString(ControlUtil.TranslateTypeToFormat(DateTimeFormatEnum.Sortable, String.Empty))
                data += DateUtil.GetCurrentUTCOffset()
                auditTrailInquiry.DateToFilter = data
            End If
            'End If


            If Not StringUtil.IsEmptyString(InstanceID) Then
                auditTrailInquiry.ObjectInstanceId = InstanceID
            Else
                auditTrailInquiry.ObjectName = Name
                If (Revision.Length > 0) Then
                    auditTrailInquiry.ObjectRevisionOrParent = Revision
                End If
                auditTrailInquiry.ObjectTypeName = ObjectTypeName
            End If

            Dim modelingHeader As ModelingAuditTrailHeader_Info = New ModelingAuditTrailHeader_Info
            modelingHeader.__info = FieldInfoUtil.RequestValue
            auditTrailHeaderInfo.Headers = modelingHeader

            Dim inputDataEvents(1) As InputDataEvent

            inputDataEvents(0) = New InputDataEvent
            inputDataEvents(0).InputData = auditTrailInquiry
            inputDataEvents(0).EventName = mkGetAuditTrailHeaders

            Dim result As ResultStatus = New ResultStatus
            If ShopFloor.WSShopFloor.PerformTransaction(inputDataEvents, auditTrailHeaderInfo, False, responseData, result) Then
                If Not responseData.Headers Is Nothing Then
                    If responseData.Headers.Length > 0 Then
                        auditTrailHeaders = CType(responseData.Headers, AuditTrailHeader())
                    End If
                End If
            Else
                DisplayMessage(result)
            End If

            Return auditTrailHeaders
        End Function ' GetModelingAuditTrailHeaders

        ' Requests audit trail details
        Private Function GetModelingAuditTrailDetails(ByVal headerId As String, ByVal objectInstanceId As String) As AuditTrail
            Dim auditTrailInquiry As ModelingAuditTrailInquiry = New ModelingAuditTrailInquiry
            Dim responseData As ModelingAuditTrailInquiry = New ModelingAuditTrailInquiry
            Dim auditTrailDetailInfo As ModelingAuditTrailInquiry_Info = New ModelingAuditTrailInquiry_Info

            Dim auditTrailDetail As AuditTrail = New AuditTrail

            auditTrailInquiry.SelectedHeader = New SubentityRef

            'Get input data from the grid row
            auditTrailInquiry.SelectedHeader.__Id = headerId
            auditTrailInquiry.SelectedObjectId = objectInstanceId

            Dim modelingDetail As ModelingAuditTrail_Info = New ModelingAuditTrail_Info
            modelingDetail.Fields = New AuditTrailField_Info
            modelingDetail.Fields.__info = FieldInfoUtil.RequestValue
            modelingDetail.DisplayName = FieldInfoUtil.RequestValue
            auditTrailDetailInfo.AuditTrailDetail = modelingDetail

            Dim inputDataEvents(1) As InputDataEvent

            inputDataEvents(0) = New InputDataEvent
            inputDataEvents(0).InputData = auditTrailInquiry
            inputDataEvents(0).EventName = mkGetAuditTrailDetails

            Dim result As ResultStatus = New ResultStatus
            Dim mShopFloor As New WSShopFloor(Session(SessionConstants.UserName), Session(SessionConstants.Password))
            If mShopFloor.PerformTransaction(inputDataEvents, auditTrailDetailInfo, False, responseData, result) Then
                auditTrailDetail = responseData.AuditTrailDetail
            Else
                DisplayMessage(result)
            End If

            Return auditTrailDetail
        End Function 'GetModelingAuditTrailDetails

        ' Grid initializing
        Protected Sub AuditTrailField_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.LayoutEventArgs) Handles AuditTrailField.InitializeLayout
            ' Initialize Width and Hidden properties of grid's columns
            For Each band As UltraGridBand In AuditTrailField.Bands
                For Each column As UltraGridColumn In band.Columns
                    Select Case True
                        Case String.Compare(column.Key, mkIdColumn) = 0 Or _
                            String.Compare(column.Key, mkHeaderIdColumn) = 0 Or _
                            String.Compare(column.Key, mkParentIdColumn) = 0 Or _
                            String.Compare(column.Key, mkObjectInstanceIdColumn) = 0 Or _
                            String.Compare(column.Key, mkExpandingColumn) = 0
                            column.Hidden = True

                        Case String.Compare(column.Key, mkDateColumn) = 0
                            column.Header.Caption = DateLabel.Text
                            column.Width = Unit.Pixel(150)

                        Case String.Compare(column.Key, mkUserColumn) = 0
                            column.Header.Caption = UserLabel.Text
                            column.Width = Unit.Pixel(150)

                        Case String.Compare(column.Key, mkExecuteActionColumn) = 0
                            column.Header.Caption = ExecuteActionLabel.Text
                            column.Width = Unit.Pixel(120)

                        Case String.Compare(column.Key, mkCommentsColumn) = 0
                            column.Header.Caption = CommentsLabel.Text
                            column.Width = Unit.Pixel(450)

                        Case String.Compare(column.Key, mkItemColumn) = 0
                            column.Header.Caption = ItemLabel.Text
                            column.Width = Unit.Pixel(120)

                        Case String.Compare(column.Key, mkItemNameColumn) = 0
                            column.Header.Caption = ItemNameLabel.Text
                            column.Width = Unit.Pixel(130)

                        Case String.Compare(column.Key, mkBeforeColumn) = 0
                            column.Header.Caption = BeforeLabel.Text
                            column.Width = Unit.Pixel(300)

                        Case String.Compare(column.Key, mkAfterColumn) = 0
                            column.Header.Caption = AfterLabel.Text
                            column.Width = Unit.Pixel(300)

                        Case String.Compare(column.Key, mkActionColumn) = 0
                            column.Header.Caption = ActionLabel.Text
                            column.Width = Unit.Pixel(100)
                    End Select
                Next
            Next
        End Sub ' AuditTrailField_InitializeLayout

        ' Row initializing
        Protected Sub AuditTrailField_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) Handles AuditTrailField.InitializeRow
            e.Row.ShowExpand = CType(e.Row.Cells.FromKey(mkExpandingColumn).Value, Boolean)

            ' TODO: should be checked when server-side core will be fixed
            ' concerning "Updated" subentities.
            If e.Row.Band.Index > 0 Then
                e.Row.Hidden = (e.Row.Cells.FromKey(mkItemColumn).Value = Nothing) And _
                    (e.Row.Cells.FromKey(mkBeforeColumn).Value = Nothing) And _
                    (e.Row.Cells.FromKey(mkAfterColumn).Value = Nothing) And _
                    (e.Row.Cells.FromKey(mkActionColumn).Value = Nothing)
            End If
        End Sub ' Row initializing

        ' Catch "__CALLBACKPARAM" callback parameter for getting additional information
        Protected Sub AuditTrailField_XmlHTTPRequest(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.XmlHTTPRequestEventArgs) Handles AuditTrailField.XmlHTTPRequest
            Dim sCallback As Infragistics.WebUI.Shared.SmartCallback = Infragistics.WebUI.Shared.SmartCallback.CreateSmartCallback(Request.Params("__CALLBACKPARAM"), Me, AuditTrailField)
            If (Not sCallback Is Nothing) Then
                Dim tplt As Triplet
                For Each tplt In sCallback.RegisteredControls
                    Dim grid As UltraWebGrid = TryCast(tplt.First, UltraWebGrid)

                    If (grid Is AuditTrailField) Then
                        Dim data As String = HttpUtility.UrlDecode(CStr(DirectCast(tplt.Second, Hashtable).Item("QueryString")).Replace("%2b", "%2b-"), Encoding.UTF7)
                        If data.StartsWith("LODXml") Then
                            Dim blocks() As String = data.Split(New Char() {ChrW(2)})
                            If blocks.Length > 2 Then
                                Dim dataKeys() As String = blocks(1).Split(New Char() {";"})
                                mExpandingRowId = Integer.Parse(dataKeys(dataKeys.Length - 1).Replace(mkIdColumn & "=", String.Empty))
                                mExpandingBandIndex = Integer.Parse(blocks(4)) - 1
                            End If
                        ElseIf data.StartsWith("Page") Then
                            IsPageRequest = True
                        End If

                        Exit For
                    End If
                Next
            End If
        End Sub ' AuditTrailField_XmlHTTPRequest

        Protected Sub CloseButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CloseButton.Click
            ' Remove stored data
            Dim store As SessionStore = FrameworkManagerUtil.GetSessionStore(Page.Session)
            If Not store Is Nothing Then
                store(PageInstanceId, SessionStoreId) = Nothing
            End If

            NotifyParent = False
            CloseWindow()
        End Sub ' CloseButton_Click

        Protected Sub btnApplyFilter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnApplyFilter.Click
            Dim dataSource As DataSet = Nothing
            'ClearMessage() 'this does not clear.  it updates to blank.  mMessageExists sets to true, which is incorrect
            Me.StatusMessage.MessageControl.Text = "" 'clear/reset

            Dim store As SessionStore = FrameworkManagerUtil.GetSessionStore(Page.Session)
            If Not store Is Nothing Then
                Me.PopupData = store(PageInstanceId, "PopupData")
            End If

            PrepareHeaders()
            If Me.StatusMessage.MessageControl.Text.ToString() <> "" Then
                Return
            End If

            dataSource = LoadHeaderItems()

            AuditTrailField.DataSource = dataSource
            AuditTrailField.DataBind()
        End Sub ' btnApplyFilter_Click

        Private Sub HandleGridClientInitialization()
            Dim key As String = "HandleGridClientInitialization"
            If Not ClientScript.IsStartupScriptRegistered(key) Then
                Dim script As String = JavascriptUtil.GetStartTag() & _
                "var OldInitGrid = igtbl_initGrid;" & _
                "igtbl_initGrid = NewInitGrid;" & _
                JavascriptUtil.GetEndTag()

                ClientScript.RegisterStartupScript(GetType(String), key, script)
            End If
            AuditTrailField.Width = Unit.Percentage(95)
        End Sub ' HandleGridClientInitialization

        Private ReadOnly Property SessionStoreId() As String
            Get
                Dim sessionId As String = ViewState(mkSessionStoreId)
                If sessionId Is Nothing Then
                    sessionId = Page.Request.Url.LocalPath + DateTime.Now.ToString("MMddHHmmssffff")
                    ViewState(mkSessionStoreId) = sessionId
                End If

                Return sessionId
            End Get
        End Property

        Private Const mkItemColumn As String = "Item"
        Private Const mkItemNameColumn As String = "ItemName"
        Private Const mkBeforeColumn As String = "Before"
        Private Const mkAfterColumn As String = "After"
        Private Const mkActionColumn As String = "Action"
        Private Const mkDateColumn As String = "Date"
        Private Const mkUserColumn As String = "User"
        Private Const mkExecuteActionColumn As String = "ExecuteAction"
        Private Const mkCommentsColumn As String = "Comments"
        Private Const mkObjectInstanceIdColumn As String = "ObjectInstanceId"
        Private Const mkHeaderIdColumn As String = "HeaderId"
        Private Const mkExpandingColumn As String = "ExpandingColumn"
        Private Const mkIdColumn As String = "Id"
        Private Const mkParentIdColumn As String = "ParentId"

        Private Const mkGetAuditTrailHeaders As String = "GetAuditTrailHeaders"
        Private Const mkGetAuditTrailDetails As String = "GetAuditTrailDetails"

        Private Const mkSessionStoreId As String = "SessionStoreId"
        Private Const mkDurationType As String = "4"

        Private mExpandingRowId As Integer = -1
        Private mExpandingBandIndex As Integer = -1
        Private IsPageRequest As Boolean = False

    End Class

End Namespace
